#include "../echo.pb.h"
#include "tinyrpc/rpc/rpcserver/rpcserver.h"
#include "tinyrpc/base/logger/logger.h"
class EchoService : public echo::EchoServiceRpc{
public:
    void echo(::google::protobuf::RpcController* controller,
                        const ::echo::EchoMessage* request,
                        ::echo::EchoMessage* response,
                        ::google::protobuf::Closure* done)
    {
        
        response->set_code(1);
        response->set_msg(request->msg());
        
    }

};

int main(){
    TinyRPC::Logger::SetLogLevel(TinyRPC::LogLevel::DEBUG);
    EchoService* service = new EchoService();
    TinyRPC::TinyRPCServer server(2);
    server.init("/media/10T/zhouxiang/CPP-Projects/TinyRPC/test/base/conf.txt");
    server.registService(service);
    
    server.start();
}